from docx import Document
from docx.enum.text import WD_ALIGN_PARAGRAPH

doc = Document()

p1 = doc.add_paragraph('水平居中')
# 设置段落水平居中
p1.paragraph_format.alignment = WD_ALIGN_PARAGRAPH.CENTER

p2 = doc.add_paragraph('左对齐')
# 设置段落左对齐
p2.paragraph_format.alignment = WD_ALIGN_PARAGRAPH.LEFT

p3 = doc.add_paragraph('右对齐')
# 设置段落右对齐
p3.paragraph_format.alignment = WD_ALIGN_PARAGRAPH.RIGHT

p4 = doc.add_paragraph()
run = p4.add_run('内联对象')
font = run.font
# 设置字体大小
font.size = Pt(35)
# 设置字体为斜体
font.italic = True


doc.save('word_text_place.docx')